//
//  MYYMeVisitorViewController.m
//  meiyinxiang
//
//  Created by 陈李飞 on 2017/10/25.
//  Copyright © 2017年 hbjApple. All rights reserved.
// 我的访客

#import "MYYMeVisitorViewController.h"
#import "MYYMeVisitorCell.h"
#import "MYY_VisitiorHeaderView.h"
#import "MYY_Me_Macro.h"
#import "MYY_VisitiortopView.h"
#import "myfollowListModel.h"

@interface MYYMeVisitorViewController ()<UITableViewDataSource, UITableViewDelegate, UIGestureRecognizerDelegate,UIActionSheetDelegate,UINavigationControllerDelegate,UIAlertViewDelegate>
@property(nonatomic, strong) UITableView *tableView;
@property (nonatomic, copy)  NSMutableArray *categorytitleArray;
@property (nonatomic, strong) NSMutableArray *dataArr;
@property (nonatomic, copy)NSMutableArray *titleArray;//文字数组
@property (nonatomic, copy)NSMutableArray *Array;//文字数组
@property (nonatomic, strong)MYY_VisitiorHeaderView *MYY_VisitiorHeaderV;
@property (nonatomic, strong)MYY_VisitiortopView *MYY_VisitiortopVi;
@end

@implementation MYYMeVisitorViewController
-(NSMutableArray *)dataArr
{
    if (!_dataArr) {
        _dataArr = [NSMutableArray array];
    }
    
    return _dataArr;
}
-(NSMutableArray *)titleArray
{
    if (!_titleArray) {
        _titleArray =[NSMutableArray array];
    }
    return _titleArray;
}
-(NSMutableArray *)Array
{
    if (!_Array) {
        _Array =[NSMutableArray array];
    }
    return _Array;
}
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:NO];
}

- (void)loadShuJu
{
    NSArray *titleArr = @[@"10月13日",
                          @"10月12日",
                          @"10月11日",
                          @"10月10日",
                          @"10月19日"];
    [self.titleArray addObjectsFromArray:titleArr];
    NSArray *titleAr = @[@"标签",
                         @"兴趣",
                         @"流年",
                         @"呵呵",
                         @"大年",
                         @"飞飞",
                         @"兴趣"];
    [self.Array addObjectsFromArray:titleAr];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self loadShuJu];
    [self createUI];
}


#pragma mark - UI

- (void)createUI
{
   
    self.tableView.backgroundColor = [UIColor colorWithRed:0.97f green:0.97f blue:0.97f alpha:1.00f];
    [self.view addSubview:self.tableView];
    [self.MYY_VisitiortopVi nameStr:@"总浏览量：   3636   今日浏览量：15"];
}
- (UITableView *)tableView
{
    if (_tableView == nil) {
        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT) style:UITableViewStyleGrouped];
        _tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
        _tableView.backgroundColor = [UIColor whiteColor];
        _tableView.dataSource = self;
        _tableView.delegate = self;
        self.MYY_VisitiortopVi=[[MYY_VisitiortopView alloc]init];
        self.MYY_VisitiortopVi.frame = CGRectMake(0, 0, _tableView.frame.size.width,30);
        _tableView.tableHeaderView =self.MYY_VisitiortopVi;
       
    }
    return _tableView;
}

#pragma mark - tableview datasource and delegate
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.Array.count;
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return self.titleArray.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    MYYMeVisitorCell *MYYMeVisitorCe = [MYYMeVisitorCell cellWithTableView:tableView];
    MYYMeVisitorCe.backgroundColor =[UIColor whiteColor];
    MYYMeVisitorCe.myfollowListMode.nickname = @"飞飞 ";
    MYYMeVisitorCe.myfollowListMode.signature = @"热完全火热开启后仍可完全融合看我热情";
   // [MYYMeVisitorCe avatarStr:@"wode_touxiang" titiStr:self.Array[indexPath.row] contentStr:@"刚萨发的撒娇官方撒个房间"];
    return MYYMeVisitorCe;

}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    return MYY_CELL_MeVisitor;
}

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    UIView *headView =[[UIView alloc]init];
    headView.backgroundColor =MYYlineColor;
    headView.frame =CGRectMake(0, 0, WIDTH, MYY_Head_MeVisitor);
    self.MYY_VisitiorHeaderV=[[MYY_VisitiorHeaderView alloc]init];
    self.MYY_VisitiorHeaderV.frame = CGRectMake(0, 0, headView.frame.size.width,headView.frame.size.height);
    [headView addSubview:self.MYY_VisitiorHeaderV];
    [self.MYY_VisitiorHeaderV nameStr:self.titleArray[section]];
    
    return headView;
}
-(CGFloat )tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
   return MYY_Head_MeVisitor;
}
-(UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
    UIView *fooerView =[[UIView alloc]initWithFrame:CGRectMake(0, 0, WIDTH, 0.1)];
    fooerView.frame =CGRectMake(0, 0, WIDTH, 0.1);
    fooerView.backgroundColor =MYYlineColor;
    return fooerView;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
     return 0.1;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
